export const baseUrl = "http://localhost:8080"
export const websocketUrl = "ws://127.0.0.1:8080/testWebsocket/"
export const downloadExcel = (data, fileName) => {
  let blob = new Blob([data], {
    type: "application/octet-stream"
  });
  let filename = fileName || "新建表格.xls";
  if (typeof window.navigator.msSaveBlob !== "undefined") {
    window.navigator.msSaveBlob(blob, filename);
  } else {
    var blobURL = window.URL.createObjectURL(blob);
    var tempLink = document.createElement("a");
    tempLink.style.display = "none";
    tempLink.href = blobURL;
    tempLink.setAttribute("download", filename);
    if (typeof tempLink.download === "undefined") {
      tempLink.setAttribute("target", "_blank");
    }
    document.body.appendChild(tempLink);
    tempLink.click();
    document.body.removeChild(tempLink);
    window.URL.revokeObjectURL(blobURL);
  }
}

